<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">

        <div>
            <ul>
                <li v-for="(item,index) in list" :key="item.id">
                    <input @click="add(index)" v-model="item.checkbox" type="checkbox">{{item.name}}</input>
                </li>
            </ul>
            <!-- <div style="width: 200px;height: 300px;">{{newItem}}</div> -->
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                list: [{
                        id: 1,
                        name: '科幻',
                        checkbox: false
                    },
                    {
                        id: 1,
                        name: '喜剧',
                        checkbox: false
                    },
                    {
                        id: 1,
                        name: '动漫',
                        checkbox: false
                    },
                    {
                        id: 1,
                        name: '冒险',
                        checkbox: false
                    },
                    {
                        id: 1,
                        name: '科技',
                        checkbox: false
                    },
                    {
                        id: 1,
                        name: '军事',
                        checkbox: false
                    },
                    {
                        id: 1,
                        name: '娱乐',
                        checkbox: false
                    },
                    {
                        id: 1,
                        name: '奇闻',
                        checkbox: false
                    },
                ],
                msg: '',
                newItem: ''
            },
            methods: {
                add(index) {
                    if (!this.list[index].checkbox) {
                        this.newItem = this.list.push({
                            id: this.list.length + 1,
                            name: this.list[index].name,
                        })
                    } else {
                        this.msg = '未选中'
                        console.log(this.msg);
                    }
                }
            }
        });
    </script>
</body>

</html>